<? 
/*
form_rule class 

@author		Jelle Versele
@email 		me@jelle.versele

*/
class form_rule{
	/*
	@var string
	*/
	private $message;
	/*
	@var string
	*/
	private $condition;
	/*
	@var bool
	*/
	private $triggered;
	/*
	@var void
	*/
	private $args;
	/*
	@var bool
	*/
	private $reverse;
	

	/*
		initialiseren van het form_rule object
		@param		string
		@param		string
		@param		void
		@param		bool
	*/
	public function __construct($iCondition, $iMessage,array $iArgs = NULL, $iReverse = false){
		
		$this -> reverse = (bool) $iReverse;
		$this -> args = $iArgs;
		$this -> triggered = false;
		$this -> message = (string) $iMessage;
		$this -> condition = (string) $iCondition;
	}
	
	
	public function getMessage(){
	
		return $this -> message;
	
	}
	
	public function getCondition(){
		
		return $this -> condition;
	
	}
	
	public function trigger(){
		
		$this -> triggered = true;
	
	}
	
	public function triggered(){
		if($this -> reverse){
			return !$this -> triggered;
		}else{
			return $this -> triggered;
		}
	
	}
	
	public function getArgs(){

		return $this -> args;
	
	
	}
}


?>